package com.webex.ta.hydra.gui.table.celleditor;

import com.webex.ta.hydra.core.Command;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-9-19
 * Time: 17:12:00
 */
public class ListEditor extends DefaultCellEditor {
    public ListEditor(JComboBox comboBox) {
        super(comboBox);
        this.setClickCountToStart(2);
    }

    @Override
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
        Command cmd = (Command) value;
        String param = cmd.getParameter(column - 2);
        return super.getTableCellEditorComponent(table, param, isSelected, row, column);
    }
}
